import request from '@/utils/request'
export default {
    //1 课程添加
    addCourseInfo(courseInfo) {
        return request({
            url: `/eduservice/course/addCourseInfo`,
            method: 'post',
            data:courseInfo
          })
    },
    //2 获取讲师列表遍历到讲师下拉选择框
    getAllTeacher() {
        return request({
            url: `/eduservice/edu-teacher/findAll`,
            method: 'get',
           
          })
    },
   //3，根据课程id查询课程基本信息
    getCourseInfoId(id){
        return request({
            url: `/eduservice/course/getCourseInfo/${id}`,
            method: 'get'
          })
    },
      //4，在返回上一步时，修改课程基本信息
      updateCourseInfo(courseInfoVo){
        return request({
            url: `/eduservice/course/updateCourseInfo`,
            method: 'post',
            data:courseInfoVo,
          })
    },
    //5，根据课程id查询课程确认信息
    getPublishCourseInfo(id){
      return request({
          url: `/eduservice/course/getPublishCourseInfo/${id}`,
          method: 'get'
        })
  },
    //6,根据课程id发布课程   pageCourseCondition
    publishCourse(id){
      return request({
          url: `/eduservice/course/publishCourse/${id}`,
          method: 'get'
        })
  },
  //7,查询课程列表进行分页显示，根据传入的对象属性进行模糊查询   pageCourseCondition
  pageCourseCondition(current,limit,coursePublishVo){
    return request({
        url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
        method: 'post',
        data: coursePublishVo
      })
},
 //8,根据课程id删除课程，以及下面的章节小节
 deleteCourseById(id){
  return request({
      url: `/eduservice/course/deleteCourseById/${id}`,
      method: 'get'
    })
},

 //9,根据传入的条件导出excel
 excel(coursePublishVo){
  return request({
      url: `/eduservice/edu-teacher/export1`,
      method: 'post',
      data: { coursePublishVo
                },
                // 二进制流文件，一定要设置成blob，默认是json
                responseType: 'blob'
    })
},
}